<template>
  <div class="Manage">
    <Header :zIndex="3" ref="Header"></Header>
    <div class="content-wrap">
      <center>
        <div class="top">
          <ul class="daohang_list">
              <li><router-link class="list_item" :to="{ path: '/Create' }">创建活动</router-link></li>
              <li><router-link class="list_item" :to="{ path: '/Manage' }">投票管理</router-link></li>
              <li><router-link class="list_item" :to="{ path: '/Level' }">账户升级</router-link></li>
              <li><router-link class="list_item on" :to="{ path: '/Userinfo' }">个人中心</router-link></li>
              <li><router-link class="list_item" :to="{ path: '/Invate' }">推荐有奖</router-link></li>
          </ul>
        </div>
        <div class="info_box">
            <div class="left">
                <div class="grzl">个人中心</div>
                <ul class="nav_child">
                  <li><router-link class="on" :to="{ path: '/Userinfo' }">个人信息</router-link></li>
                  <li><router-link :to="{path: '/Account'}">收款信息</router-link></li>
                  <li><router-link :to="{path: '/Address'}">收件地址</router-link></li>
                  <li><router-link :to="{path: '/Invoice'}">发票信息</router-link></li>
                  <li><router-link :to="{path: '/InvoiceRecord'}">发票管理</router-link></li>
                  <li><router-link :to="{path: '/DrawList'}">提现记录</router-link></li>
                  <li><router-link :to="{ path: '/Logs' }">消费记录</router-link></li>
                  <li><router-link :to="{ path: '/Editpass' }">修改密码</router-link></li>
                </ul>
            </div>
            <div class="iinforignt" style="padding-top: 40px">
                <ul style="margin-left: 318px; text-align: left">
                <li>
                    <span class="left_txt">用户名称：</span>
                    <span style="color: #ff6e00; font-weight: bold">{{userInfo.userName}}</span>
                </li>
                <li>
                    <span class="left_txt">注册时间：</span><span>{{formatDate(userInfo.regtime)}}</span>
                </li>
                <li><span class="left_txt">当前版本：{{levelName[userInfo.level]}}</span></li>
                </ul>
            </div>
            <div class="clear"></div>
        </div>
      </center>
    </div>
    <Footer></Footer>
  </div>
</template>

<script>
import User from '../../utils/user'
import Footer from '../components/Footer.vue'
import Header from '../components/Header.vue'
export default {
  name: 'Userinfo',
  components: {
    Header,
    Footer
  },
  data () {
    return {
      userInfo: {}
    }
  },
  created () {
    var token = localStorage.getItem('token');
    this.userInfo = User.getInfo();
    if(!token || !this.userInfo) {
      this.$router.replace('/Login');
      return;
    }
    this.setTitle('用户中心');
  },
  methods: {
  }
}
</script>
<style src="@/assets/css/manage.css"  scoped></style>
<style src="@/assets/css/userinfo.css"  scoped></style>
